﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CostingDetail.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Quan tri he thong</title>
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />

    <script src="assets/js/Admin_002.js" type="text/javascript"></script>

    <script src="assets/js/Admin.js" type="text/javascript"></script>

    <script src="assets/js/jquery.js" type="text/javascript"></script>

    <script src="assets/js/jquery.validate.js" type="text/javascript"></script>

    <script type='text/javascript' src="assets/js/common.js"></script>
    <script type='text/javascript' src="assets/js/Validation.js"></script>
    

    <style type="text/css">
    .key 
    {
        width: 70px !important;    
         border-bottom:1px solid #E9E9E9;   
         border-right:1px solid #E9E9E9;   
        }
         .key1 
    {
        width: 160px !important;    
         border-bottom:1px solid #E9E9E9;   
         border-right:1px solid #E9E9E9;   
        }
    .row {
         border-bottom:1px solid #E9E9E9;
         border-right:1px solid #E9E9E9;   
         width:150px;
         }
    </style>

    <script type="text/javascript">
    function CloseWindow() {
        window.close();
    }
       function doOpenQuantity(OfferPriceID,CustID)
    {    
	    var tid= getUrlVars()['tid'];                  
        url = "OfferPriceQuantity.aspx?view=0&CustID=" + CustID+"&OfferPriceID="+OfferPriceID;
        window.open(url,'OfferPriceQuantity','width=800,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
    }
    </script>

</head>
<body>
    <div id="body-wrapper">
        <div id="main-content1" style="padding: 0px; margin: 20px 0px 10px 0px;">
            <div class="">
            </div>
            <h2>
                COSTING DETAIL</h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmEdit" runat="server" method="post">
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">
                            Thông tin chi tiết:<span style="font-style: italic; font-size: 12px; color: Red;"><%=strRemainingDay %></span>
                        </h3>
                        <div class="clear">
                        </div>
                    </div>
                    <div>
                        <asp:Label ID="ErrMessage" runat="server" CssClass="error"></asp:Label>
                    </div>
                    <fieldset class="adminform">
                        <table class="paramlist admintable " style="width: 100%; text-align: le">
                            <%if (strStatus == 0)
                                  { %>
                            <tr>
                                <td class="key">
                                    Cost No.:</td>
                                <td align="left" class="row">
                                    <asp:TextBox ID="txtCostNo" name="txtCostNo" runat="server" Width="90%"></asp:TextBox></td>
                                <td class="key">
                                    Etd:</td>
                                <td class="row">
                                    <asp:TextBox ID="txtEtd" name="txtEtd" runat="server" Width="90%"
                                     onkeyup="dtval(this,event)" MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                                </td>
                                <td td class="key">
                                    Note:</td>
                                <td>
                                    <asp:TextBox ID="txtNote" name="txtNote" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td td class="key">
                                    Prepaid:</td>
                                <td>
                                    <asp:CheckBox ID="cbPrepaid" name="cbPrepaid" runat="server"></asp:CheckBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="key">
                                    Cust Pic:</td>
                                <td align="left" class="row">
                                    <asp:TextBox ID="txtCustPic" name="txtCustPic" runat="server" Width="90%"></asp:TextBox></td>
                                <td class="key">
                                    Carr Sale:</td>
                                <td class="row">
                                    <asp:TextBox ID="txtCarrierSale" name="txtCarrierSale" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td td class="key">
                                    Pricing Name:</td>
                                <td>
                                    <asp:TextBox ID="txtOther" name="txtOther" runat="server" Width="90%"></asp:TextBox>
                                </td>
                                <td td class="key">
                                    Collect:</td>
                                <td>
                                    <asp:CheckBox ID="cbCollect" name="cbCollect" runat="server"></asp:CheckBox>
                                </td>
                            </tr>
                            <%} %>
                            <%if (strStatus > 0)
                                  { %>
                            <tr>
                                <td class="key">
                                    COST NO.:</td>
                                <td align="left" class="row">
                                    <%=strCostNo %>
                                </td>
                                <td class="key">
                                    ETD:</td>
                                <td class="row">
                                    <%=strCostEdt %>
                                </td>
                                <td td class="key">
                                    NOTE:</td>
                                <td>
                                    <%=strCostNote %>
                                </td>
                            </tr>
                            <%} %>
                        </table>
                        <asp:Repeater ID="rptCosting" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <%if (strStatus > 0){%>
                                    <td align="center" width="184px;" class="row">
                                        <%# DataBinder.Eval(Container.DataItem, "CostContainerType")%>
                                    </td>
                                    <td align="center" class="row">
                                        <%# DataBinder.Eval(Container.DataItem, "CostBuy")%>
                                    </td>
                                    <td align="center" class="row">
                                        <%# DataBinder.Eval(Container.DataItem, "CostSell")%>
                                    </td>
                                    <td align="center" class="row">
                                        <%# DataBinder.Eval(Container.DataItem, "CostInv")%>
                                    </td>
                                    <td align="center" class="row">
                                        <%# DataBinder.Eval(Container.DataItem, "CostDiscount")%>
                                    </td>
                                    <%}else{ %>
                                    <td align="center" width="184px;" class="row">
                                        <asp:HiddenField ID="ID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
                                        </asp:HiddenField>
                                        <asp:TextBox ID="txtCostContainerType" runat="server" Width="85%" Text='<%# DataBinder.Eval(Container.DataItem, "CostContainerType")%>'
                                            CssClass="clsPol"></asp:TextBox>
                                    </td>
                                    <td align="center" class="row">
                                        <asp:TextBox ID="txtCostBuy" runat="server" Width="85%" Text='<%# DataBinder.Eval(Container.DataItem, "CostBuy")%>'
                                            CssClass="clsPod"></asp:TextBox>
                                    </td>
                                    <td align="center" class="row">
                                        <asp:TextBox ID="txtCostSell" runat="server" Width="85%" Text='<%# DataBinder.Eval(Container.DataItem, "CostSell")%>'></asp:TextBox>
                                    </td>
                                    <td align="center" class="row">
                                        <asp:TextBox ID="txtCostInv" runat="server" Width="85%" Text='<%# DataBinder.Eval(Container.DataItem, "CostInv")%>'></asp:TextBox>
                                    </td>
                                   <td align="center" class="row">                                   
                                        <asp:TextBox ID="txtCostDiscount" ReadOnly="true" runat="server" Width="85%" Text='<%# DataBinder.Eval(Container.DataItem, "CostDiscount")%>'></asp:TextBox>                                       
                                    </td>
                                    <%} %>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" width="100%" border="0" class="AdminList">
                                    <thead>
                                        <tr>
                                            <th colspan="5">
                                            </th>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                    </fieldset>
                    <fieldset>
                        <table class="adminform">
                            <%if (strStatus > 0)
                              { %>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    Người gửi:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostSale %>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    Ngày gửi:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strUpdate %>
                                </td>
                            </tr>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    Khách hàng:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCustomer %>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    Vol/Shipment:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostShipment %>                                   
                                </td>
                            </tr>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    POL:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostPol %>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    POD:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostPod%>
                                </td>
                            </tr>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    Agent:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostAgent%>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    Cust Pic:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostCustPic%>
                                </td>
                            </tr>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    Carr Sale:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostCarrierSale %>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    Other:</td>
                                <td align="left" class="row" colspan="7">
                                    <%=strCostOther%>
                                </td>
                            </tr>
                            <tr>
                                <td class="key" align="left" width="100px;">
                                    Prepaid:</td>
                                <td align="left" class="row" colspan="7">
                                    <%if (strCostPrepaid == "1")
                                      {%>
                                    <input type="checkbox" checked="checked" disabled>
                                    <%}
                                      else
                                      { %>
                                    <input type="checkbox" disabled>
                                    <%} %>
                                </td>
                                <td class="key" align="left" width="100px;">
                                    Collect:</td>
                                <td align="left" class="row" colspan="7">
                                    <%if (strCostCollect == "1")
                                      {%>
                                    <input type="checkbox" checked="checked" disabled>
                                    <%}
                                      else{ %>
                                    <input type="checkbox" disabled>
                                    <% }%>
                                </td>
                            </tr>
                            <%} %>
                        </table>
                    </fieldset>
                    <% if (Request.QueryString["view"] != null && Request.QueryString["view"].ToString() == "0")
                              { %>
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">
                            Phân loại khách hàng:
                        </h3>
                        <div class="clear">
                        </div>
                    </div>                     
                    <fieldset class="adminform">
                        <table class="paramlist admintable " width="100%">
                            <tr>
                                <td class="key1" align="left">
                                    Loại khách hàng:
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevel" runat="server" Width="85%"></asp:Label>
                                </td>
                                <td class="key1" align="left" width="20%">
                                    Hạn mức:
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevelCusLimit" runat="server" Width="85%"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="key1" align="left" style="width: 120px;">
                                    Công nợ (ngày):
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevelLiabilities" runat="server" Width="85%"></asp:Label>
                                </td>
                                <td class="key1" align="left" width="20%">
                                    Phát sinh nợ đến nay:
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevelDebts" runat="server" Width="85%"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="key1" align="left">
                                    TB (%):
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevelTB" runat="server" Width="85%"></asp:Label>
                                </td>
                                <td class="key1" align="left" width="20%">
                                    Note:
                                </td>
                                <td align="left" class="row">
                                    <asp:Label ID="lblCusLevelNote" runat="server" Width="85%"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <%} %>
                    <br />
                    <div class="clear">
                    </div>
                    <%if (strStatus == 0)
                      { %>
                    <div style="margin-top: 5px; width: 100%">
                        <asp:Button ID="btnSave" runat="server" Text="Update" class="button" OnClick="btnSave_Click" />
                        &nbsp;
                        <!--asp:Button ID="btnSend"  Text="Send" class="button" OnClick="btnSend_Click" /-->
                        &nbsp;<input type="button" id="Button1" value="Exit" class="button" onclick="window.close();" />
                    </div>
                    <%}
                      else
                      { %>
                    <input type="button" id="Button2" value="Exit" class="button" onclick="window.close();" />
                    <%} %>
                </form>
            </div>
            <!--div id="footer">
                &nbsp;</div-->
        </div>
    </div>
</body>
</html>
